package com.jctrip.hotel.source.model.CnBooking.req;

import java.util.List;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author henry
 * @Date 2023/7/31 16:56
 * @Description
 */
@Data
public class BookingReq extends BaseRequest {
    @JacksonXmlElementWrapper(localName = "SearchConditions")
    @JacksonXmlProperty(localName = "SearchConditions")
    private BookingConditions searchConditions;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BookingConditions {
        @JacksonXmlProperty(localName = "HotelId")
        private String hotelId;
        @JacksonXmlProperty(localName = "RoomId")
        private String roomId;
        @JacksonXmlProperty(localName = "RateplanId")
        private String rateplanId;
        @JacksonXmlProperty(localName = "CheckIn")
        private String checkIn;
        @JacksonXmlProperty(localName = "CheckOut")
        private String checkOut;
        @JacksonXmlProperty(localName = "RoomCount")
        private String roomCount;
        @JacksonXmlProperty(localName = "Currency")
        private String currency;
        @JacksonXmlProperty(localName = "OrderAmount")
        private String orderAmount;
        @JacksonXmlProperty(localName = "BookInfo")
        @JacksonXmlElementWrapper
        private BookInfo bookInfo;
        @JacksonXmlElementWrapper(localName = "GuestInfos")
        @JacksonXmlProperty(localName = "GuestInfo")
        private List<GuestInfo> guestInfos;
        @JacksonXmlProperty(localName = "SpecialRemark")
        private String specialRemark;
        @JacksonXmlProperty(localName = "Reserve")
        @JacksonXmlElementWrapper
        private Reserve reserve;
        @JacksonXmlProperty(localName = "CustomerOrderId")
        private String customerOrderId;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BookInfo {
        @JacksonXmlProperty(localName = "BookName")
        private String bookName;
        @JacksonXmlProperty(localName = "BookPhone")
        private String bookPhone;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class GuestInfo {
        @JacksonXmlProperty(localName = "GuestName")
        private String guestName;
        @JacksonXmlProperty(localName = "GuestPhone")
        private String guestPhone;
        @JacksonXmlProperty(localName = "GuestFax")
        private String guestFax;
        @JacksonXmlProperty(localName = "GuestType")
        private String guestType;
        @JacksonXmlProperty(localName = "CardTypeId")
        private String cardTypeId;
        @JacksonXmlProperty(localName = "CardNum")
        private String cardNum;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Reserve {
        @JacksonXmlProperty(localName = "Reserve1")
        private String reserve1;
        @JacksonXmlProperty(localName = "Reserve2")
        private String reserve2;
    }

}
